<?php
//Start session
session_start();

//Check whether the session variable SESS_MEMBER_ID is present or not
if (!isset ($_SESSION['SESS_MEMBER_ID']) || (trim($_SESSION['SESS_MEMBER_ID']) == '')) {
	header("location: access-denied.php");
	exit ();
}

include_once("config.php");

$con = mysql_connect(DB_HOST, DB_USER, DB_PASSWORD);
if (!$con)
	die('Could not connect: ' . mysql_error());

mysql_select_db(DB_DATABASE, $con);
if (mysql_num_rows(mysql_query("select * from member_details where admin = 1 and userid='$_SESSION[SESS_MEMBER_ID]'")) == 0) {
	header("location: access-denied.php");
	exit ();	
}

?>
